package com.visitor.utils;


import java.text.SimpleDateFormat;
import java.util.Date;

/**
  * @Description(功能描述): 时间工具类
  **/
public class DateUtils {

	public static String getTime(){
		SimpleDateFormat simpleDateFormat=new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");
		return simpleDateFormat.format(new Date());
	}
	public static String getTime2(){
		SimpleDateFormat simpleDateFormat=new SimpleDateFormat("YYYYMMddHH");
		return simpleDateFormat.format(new Date());
	}
	public static String getTime3(){
		SimpleDateFormat simpleDateFormat=new SimpleDateFormat("YYYYMMdd");
		return simpleDateFormat.format(new Date());
	}

	public static void main(String[] args){
	    System.out.println(getTime());
	    System.out.println(getTime2());
	}
}
